<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<textarea id="t1"></textarea>
		<input type="button" id="btn" value="运行" />
	</body>
</html>

<script type="text/javascript">
	// 打开一个新窗口,并且把textArea里面的内容写入新窗口
	document.getElementById('btn').onclick = function() {
		var w = window.open('');
		var text = document.getElementById('t1').value;
		w.document.write(text);
	}
	
</script>

